from ultralytics import YOLO

# 放在主模块保护内，避免多进程重复执行
if __name__ == '__main__':
    # 加载模型
    model = YOLO("yolov8n.pt")

    # 训练模型
    results = model.train(
        data="tongue.yaml",
        epochs=100,
        workers=4,
        batch=16,
        task="detect"
    )